package com.design.cjm.behavioral.command.example1;

/**
 * @Author: Jie Ming Chen
 * @Date: 2018/9/28
 * @Version 1.0
 */
public class TestApp {

    public static void main(String[] args) {

        Invoker invoker = new Invoker();

        Light light = new Light();

        Command lightOnCommand = new LightOnCommand(light);
        Command lightOffCommand = new LightOffCommand(light);

        invoker.setOnCommand(lightOnCommand, 0);
        invoker.setOffCommand(lightOffCommand, 0);

        invoker.onButtonWasPushed(0);
        invoker.offButtonWasPushed(0);
    }
}
